Release v4.28.1#24
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix incorrect math in
OperatorsandColor, found while adding a unit test suite for the library's pure-logic classes (Operators,extensions/math,extensions/shape,extensions/hitbox,extensions/color).Operators.asinOf,Operators.acosOf,Operators.atanOf: these applied the degrees conversion to the input before taking the inverse trig function, and never converted the result back to degrees, soasinOf/acosOfreturnedNaNfor almost any real input, andatanOfreturned radians instead of degrees. They now correctly return the degree-valued inverse ofsinOf/cosOf/tanOf(e.g.asinOf(1.0) == 90.0).Operators.max(double...): seeded its accumulator withDouble.MIN_VALUE(the smallest positive double) instead ofDouble.NEGATIVE_INFINITY, so it returned the wrong result whenever every input was negative. Fixed to seed withDouble.NEGATIVE_INFINITY.Color(double r, double g, double b): passedgtwice tosetRGB, silently dropping the blue channel and replacing it with the green value. Fixed to passr, g, b. This also correctsGifRecorder.transparent, which is constructed with this constructor.Fix
Sprite.DIRECTION_RIGHT/DIRECTION_UP/DIRECTION_LEFT/DIRECTION_DOWN(introduced in the previous release) having their degree values swapped relative to howSprite.move()andsetDirection()actually behave. A sprite's default direction is90, which moves it along +x ("right"), andmove()'s trig confirms the real convention — matching real Scratch — is0 = up, 90 = right, 180 = down, 270 = left. The constants previously claimed0 = right, 90 = up, 180 = left, 270 = down, the opposite of reality. Also corrected the matching descriptions insetDirection()'s andpointInDirection()'s Javadoc, which had the same swap.No shipped example or demo used these constants, so this only affects code written against the just-released values.
MapObject.getProperty()now throws a helpful error message naming the missing property and, when available, the properties that do exist on that map object — instead of a bareNoSuchElementExceptionwith no context. It also now gives a clear message when the map object has no custom properties at all, rather than a rawNullPointerException. This matches the library's existing beginner-friendly error reporting for missing assets.